#!/usr/bin/python
'''
/*
 * This computer program is the confidential information and proprietary trade
 * secret of VistaraIT LLC.  Possessions and use of this program must  conform
 * strictly to the license agreement between the user and VistaraIT LLC.,  and
 * receipt or possession does not convey any rights to divulge, reproduce,  or
 * allow others to use this program without specific written authorization  of
 * VistaraIT LLC.
 * 
 * Copyright (c) 2014 VistaraIT, Inc. All rights reserved.
 */
'''

import datetime

_date_format = '%m/%d/%Y %H:%M:%S'

def getCurrentTimeAsString():
    return datetime.datetime.now().strftime(_date_format)

def getCurrentTime():
    return datetime.datetime.now()

def convertStringTODate(dateString):
    return datetime.datetime.strptime(dateString,_date_format)

def getDateDiffInDays(date1,date2):
    try:
        return (date1 - date2).days
    except:
        return datetime.timedelta(seconds=0)

def getDateStringfromTS(timestamp):
    return datetime.datetime.fromtimestamp(timestamp)
